<%@page import = "support.*, java.util.*" %>
<html>
	<head><title>Provide Degrees - Choose Location</title></head>

<%
if(session.getAttribute("country").equals("United States"))
{
	session.setAttribute("street",request.getAttribute("street"));
	session.setAttribute("city",request.getAttribute("city"));
	if(session.getAttribute("residence").equals("United States"))
	{		
		session.setAttribute("state",request.getAttribute("state"));
	}
	else
	{
		session.setAttribute("code",request.getAttribute("code"));
	}
	session.setAttribute("zipCode",request.getAttribute("zipCode"));
	session.setAttribute("areaCode",request.getAttribute("areaCode"));
	session.setAttribute("number",request.getAttribute("number"));
}
String stringCount = (String)session.getAttribute("count");
int count = Integer.parseInt(stringCount);
count++;
stringCount = Integer.toString(count);
session.setAttribute("count",stringCount);

%>
Please choose your school location.
<p>
States in United States :
<p>
<% 
   	support s = new support();   	
   	String path2 = config.getServletContext().getRealPath("universities.txt");
   	Vector universities = s.getUniversities(path2); 
%>
<%
		for (int i = 0; i < universities.size(); i++) {
			Vector universityList = (Vector)universities.get(i);
			String state = (String)universityList.get(0);
			%>
			<a href="university.jsp?location<%=stringCount%>=<%=state%>"><%=state%></a>
			<%
			if( (i+1)%3 == 0)
				out.println("<br>");
	}
%>
<p>
Country:
<p>
<%   		
   	String path1 = config.getServletContext().getRealPath("countries.txt");
    	Vector countries = s.getCountries(path1); 
%>
<%
	for(int i = 0; i < countries.size(); i++){
	String cn = (String)countries.get(i);
%>
	<a href="university.jsp?location<%=stringCount%>=<%=cn%>"><%=countries.get(i)%></a>
<% out.println(" ");
	if((i + 1) % 3 == 0)
		out.println("<br>");
	}
    	out.println("<br>");
	%>
<p>
